package com.lee.rpc.protocal.spring.service;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
 
import com.lee.rpc.protocal.spring.service.SpringRpcProviderBean;

@Configuration
@EnableConfigurationProperties(RpcServerProperties.class)
public class RpcProviderAutoConfiguration {

	@Bean
	public SpringRpcProviderBean springRpcProviderBean(RpcServerProperties rpcServerProperties) {
		return new SpringRpcProviderBean(rpcServerProperties.getServiceAddress(), rpcServerProperties.getServicePort());
	}
}
